package com.urlEncoderTool;

import cn.hutool.core.net.URLEncoder;

import java.nio.charset.Charset;

/**
 * url中文decoder
 *
 * @author zhanghuibo
 * @version 1.0.0
 * @package com.urlEncoder
 * @className MurlEncoder
 * @date 2025-05-29  17:59
 */
public class MyUrlEncoder {
    public static void main(String[] args) {
        String originalUrl = "https://www.example.com/search?query=你好世界";
        String encodedUrl = URLEncoder.createDefault().encode(originalUrl, Charset.defaultCharset());
        System.out.println(encodedUrl);
    }
}
